const prefix = this.pageObj.getVariables().find(v => v.name === "environmentType")?.value;
async function basePost(url, params) {
  return fetch(url, {
    method: 'POST',
    headers: { "Content-type": "application/json" },
    body: JSON.stringify(params),
  }).then(res => res.json());
}
// const whether_process = this.pageObj.getVariables().find(v => v.name === 'whether_process')?.value || 0
basePost(`/${prefix}Event/event/selectNewEventList`, { processType: 1 })
  .then(({ success, result }) => {
    console.log('res', { success, result });
    if(success && result && Array.isArray(result.result)) {
      const data =  result.result.map(item => ({
        ...item,
        title: item.projectName,
        id: `all-${item.projectName}`,
        count: item.alarmNum
      }));
      this.widgetObj.setData([{data}]);
      this.widgetObj.render()
    }
  }).catch(e => {
  console.error('获取最新', e)
});